|
The LLVM compiler infrastructure project (formerly Low Level Virtual Machine) is a compiler infrastructure designed to be a set of reusable libraries with well-defined interfaces. LLVM is written in C++ and is designed for compile-time, link-time, run-time, and "idle-time" optimization of programs written in arbitrary programming languages. Originally implemented for C and C++, the language-agnostic design of LLVM has since spawned a wide variety of front ends: languages with compilers that use LLVM include Common Lisp, ActionScript, Ada, D, Fortran, OpenGL Shading Language, Go, Haskell, Java bytecode, Julia, Objective-C, Swift, Python, R, Ruby, Rust, Scala, C#〔(LLVM ), Chris Lattner, in (The architecture of Open Source Applications ), edited by Amy Brown, Greg Wilson, 2011〕 and Lua. The LLVM project started in 2000 at the University of Illinois at Urbana–Champaign, under the direction of Vikram Adve and Chris Lattner. LLVM was originally developed as a research infrastructure to investigate dynamic compilation techniques for static and dynamic programming languages. LLVM was released under the University of Illinois/NCSA Open Source License,〔 a permissive free software licence. In 2005, Apple Inc. hired Lattner and formed a team to work on the LLVM system for various uses within Apple's development systems. LLVM is an integral part of Apple's latest development tools for Mac OS X and iOS. Quite recently, Sony has been using LLVM's primary front end Clang compiler in the software development kit (SDK) of its PS4 console. The name ''LLVM'' was originally an initialism for ''Low Level Virtual Machine'', but this became increasingly less apt as LLVM became an umbrella project that included a variety of other compiler and low-level tool technologies, so the project abandoned the initialism.〔(【引用サイトリンク】url=http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-December/046440.html )〕 Now, LLVM is a brand that applies to the LLVM umbrella project, the LLVM intermediate representation, the LLVM debugger, the LLVM C++ standard library, etc. LLVM is administered by the LLVM Foundation. Its president is Tanya Lattner, a compiler engineer and Chris Lattner's spouse. The Association for Computing Machinery presented Adve, Lattner, and Evan Cheng with the 2012 ACM Software System Award for LLVM.〔(【引用サイトリンク】title=ACM Awards )〕 == Overview and description == LLVM can provide the middle layers of a complete compiler system, taking intermediate form (IF) code from a compiler and emitting an optimized IF. This new IF can then be converted and linked into machine-dependent assembly code for a target platform. LLVM can accept the IF from the GCC toolchain, allowing it to be used with a wide array of extant compilers written for that project. LLVM can also generate relocatable machine code at compile-time or link-time or even binary machine code at run-time. LLVM supports a language-independent instruction set and type system.〔(【引用サイトリンク】 title=LLVM Language Reference Manual )〕 Each instruction is in static single assignment form (SSA), meaning that each variable (called a typed register) is assigned once and is frozen. This helps simplify the analysis of dependencies among variables. LLVM allows code to be compiled statically, as it is under the traditional GCC system, or left for late-compiling from the IF to machine code in a just-in-time (JIT) compiler fashion similar to Java. The type system consists of basic types such as integers or floats and five derived types: pointers, arrays, vectors, structures, and functions. A type construct in a concrete language can be represented by combining these basic types in LLVM. For example, a class in C++ can be represented by a combination of structures, functions and arrays of function pointers. The LLVM JIT compiler can optimize unneeded static branches out of a program at runtime, and thus is useful for partial evaluation in cases where a program has many options, most of which can easily be determined unneeded in a specific environment. This feature is used in the OpenGL pipeline of Mac OS X Leopard (v10.5) to provide support for missing hardware features.〔 〕 Graphics code within the OpenGL stack was left in intermediate form, and then compiled when run on the target machine. On systems with high-end GPUs, the resulting code was quite thin, passing the instructions onto the GPU with minimal changes. On systems with low-end GPUs, LLVM would compile optional procedures that run on the local central processing unit (CPU) that emulate instructions that the GPU cannot run internally. LLVM improved performance on low-end machines using Intel GMA chipsets. A similar system was developed under the Gallium3D LLVMpipe, and incorporated into the GNOME shell to allow it to run without a proper 3D hardware driver loaded.〔Michael Larabel, ("GNOME Shell Works Without GPU Driver Support" ), ''phoronix'', 6 November 2011〕 When it comes to the run-time performance of the compiled programs, GCC previously outperformed LLVM by about 10% on average.〔(【引用サイトリンク】 author=V. Makarov )〕〔(【引用サイトリンク】 author=V. Makarov )〕 Newer results do indicate, however, that LLVM has now caught up with GCC in this area, and is now compiling binaries of approximately equal performance, except for programs using OpenMP. 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「LLVM」の詳細全文を読む スポンサード リンク
|